<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- creator-ios-dev.qdoc -->
  <title>Connecting iOS Devices | Qt Creator Manual</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="index.html">Qt Creator Manual</a></td><td >Connecting iOS Devices</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="index.html">Qt Creator Manual 4.11.1</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
  <link rel="prev" href="creator-developing-generic-linux.html" />
  <link rel="next" href="creator-developing-mcu.html" />
<p class="naviNextPrevious headerNavi">
<a class="prevPage" href="creator-developing-generic-linux.html">Connecting Embedded Linux Devices</a>
<span class="naviSeparator">  &#9702;  </span>
<a class="nextPage" href="creator-developing-mcu.html">Connecting MCUs</a>
</p><p/>
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#configuring-devices">Configuring Devices</a></li>
<li class="level1"><a href="#viewing-device-connection-status">Viewing Device Connection Status</a></li>
<li class="level1"><a href="#specifying-supported-ios-versions">Specifying Supported iOS Versions</a></li>
<li class="level1"><a href="#testing-on-simulator">Testing on Simulator</a></li>
<li class="level2"><a href="#managing-simulators">Managing Simulators</a></li>
<li class="level2"><a href="#checking-current-xcode-version">Checking Current Xcode Version</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Connecting iOS Devices</h1>
<span class="subtitle"></span>
<!-- $$$creator-developing-ios.html-description -->
<div class="descr"> <a name="details"></a>
<p>You can connect iOS devices to your local machine with a USB cable to run applications built for them from Qt Creator.</p>
<p>To be able to use Qt Creator on <a href="nolink">macOS</a>, you must install Xcode, and therefore, you already have the tool chain for building applications for iOS. Qt Creator automatically detects the tool chain and creates the necessary <a href="creator-glossary.html#glossary-buildandrun-kit">kits</a> to build applications for and run them on configured iOS devices.</p>
<p>You only need Qt libraries that are built for iOS. You can install them as part of Qt 5.2, or later.</p>
<a name="configuring-devices"></a>
<h2 id="configuring-devices">Configuring Devices</h2>
<p>The connections between Qt Creator and an iOS device are protected by using a certificate that you receive from Apple when you <a href="https://developer.apple.com/programs/enroll/">enroll in the Apple Developer Program</a>. The certificate is copied to the device when you configure the device.</p>
<p>The first time you connect the device to your local machine, you are asked to enable developer mode on the device. The next time you connect the device, Qt Creator detects it automatically. To disable automatic connections to a device that you do not use for development, select <b>Preferences</b> &gt; <b>iOS</b>, and deselect the <b>Ask about devices not in developer mode</b> check box.</p>
<p><b>Note: </b>The process of configuring devices and the UI varies slightly depending on the Xcode version that you use. We recommend that you use the latest available Xcode version.</p><p>To configure connections between Qt Creator and an iOS device:</p>
<ol class="1" type="1"><li>Make sure that you have Xcode and Qt for iOS installed.</li>
<li>Connect the device to your local machine with a USB cable.</li>
<li>Start Xcode to configure the device.<p>For example, in Xcode version 7.3&#x2e;0, select <b>Window</b> &gt; <b>Device</b> &gt; <b>+</b> &gt; <b>Add Device</b> to add the connected device.</p>
</li>
<li>To specify build settings:<ol class="1" type="1"><li>Open a project for an application you want to develop for the device.</li>
<li>Select <b>Projects</b> &gt; <b>Build &amp; Run</b> to select the kit for building applications for and running them on iOS.<p class="centerAlign"><img src="images/qtcreator-ios-add-kit.png" alt="&quot;Build &amp; Run Settings&quot;" /></p></li>
<li>In <b>iOS Settings</b>, select the development team to use for signing and provisioning applications. You must configure development teams and provisioning profiles in Xcode using an Apple developer account.<p class="centerAlign"><img src="images/qtcreator-build-settings-ios.png" alt="&quot;iOS build settings&quot;" /></p></li>
<li>Select the <b>Automatically manage signing</b> check box to automatically select the provisioning profile and signing certificate on your local machine that matches the entitlements and the bundle identifier of the iOS device.</li>
</ol>
</li>
<li>Select <b>Run</b> to specify run settings.<p>Usually, you can use the default settings.</p>
<p>When you run the project, Qt Creator uses Xcode to deploy the application to the device.</p>
<p>Your signing certificate is used to sign application packages for deployment to the device.</p>
</li>
</ol>
<p><b>Note: </b>If you cannot deploy applications, because a provisioning profile is missing, check that provisioning profiles are listed in Xcode by selecting <b>Xcode</b> &gt; <b>Preferences</b> &gt; <b>Accounts</b>. For more information about how to acquire and install a provisioning profile, see Apple documentation.</p><a name="viewing-device-connection-status"></a>
<h2 id="viewing-device-connection-status">Viewing Device Connection Status</h2>
<p>When you connect an iOS device to your local machine with USB, Qt Creator automatically detects the device if you have configured it by using Xcode. To view information about the connected device, select <b>Preferences</b> &gt; <b>Devices</b>.</p>
<p class="centerAlign"><img src="images/qtcreator-ios-device-configurations.png" alt="&quot;Devices dialog&quot;" /></p><p>If the current device state is <b>Connected</b>, (the traffic light icon is orange), you need to configure the device using Xcode.</p>
<a name="specifying-supported-ios-versions"></a>
<h2 id="specifying-supported-ios-versions">Specifying Supported iOS Versions</h2>
<p>Qt 5 applications can be built for the latest iOS version and deployed to previous versions. For the most part, this works automatically. However, you must take care when you manually set your own target version. If you set it to a value higher than what Qt requires and supply your own <code>Info.plist</code> file, you must add an <code>LSMinimumSystemVersion</code> entry to the <code>Info.plist</code> that matches the value of <code>QMAKE_IOS_DEPLOYMENT_TARGET</code> (when using qmake) or <code>cpp.minimumIosVersion</code> (when using Qbs), because iOS (and the App Store) will use the <code>LSMinimumSystemVersion</code> value as the authoritative one.</p>
<p>If you specify a deployment target value lower than what Qt requires, your application will almost certainly crash somewhere in the Qt libraries when run on an older version than Qt supports. Therefore, make sure that the actual build system code reflects the minimum iOS version that is actually required.</p>
<p>For more information, see <a href="http://doc.qt.io/qt-5/ios-platform-notes.html#expressing-supported-ios-versions">Expressing Supported iOS Versions</a>.</p>
<a name="testing-on-simulator"></a>
<h2 id="testing-on-simulator">Testing on Simulator</h2>
<p>If you do not have an iOS device or you do not want to create an account, you can test applications on <a href="http://developer.apple.com/library/ios/documentation/IDEs/Conceptual/iOS_Simulator_Guide/Introduction/Introduction.html">Simulator</a>, which is installed as part of Xcode. Each Xcode version simulates a predefined set of hardware devices and software versions.</p>
<p>You can change the simulated hardware and software version in the run settings for the project. Select <b>Projects</b> &gt; <b>Run</b>, and then select the device to simulate in the <b>Device type</b> field.</p>
<p class="centerAlign"><img src="images/qtcreator-ios-simulator-deploy.png" alt="" /></p><p>The simulator is started automatically when you run the application. To start the simulator manually, select <b>Preferences</b> &gt; <b>Devices</b> &gt; <b>iOS</b> &gt; <b>Start</b>.</p>
<p>To take screenshots of the simulator, select <b>Preferences</b> &gt; <b>Devices</b> &gt; <b>iOS</b> &gt; <b>Screenshot</b>. The screenshots are stored in the directory specified in the <b>Screenshot directory</b> field.</p>
<a name="managing-simulators"></a>
<h3 id="managing-simulators">Managing Simulators</h3>
<p>The available simulators are listed in <b>Preferences</b> &gt; <b>Devices</b> &gt; <b>iOS</b>.</p>
<p class="centerAlign"><img src="images/qtcreator-ios-preferences.png" alt="" /></p><p>To create a new simulator instance:</p>
<ul>
<li>Select <b>Create</b>.</li>
<li>In the <b>Device type</b> field, select the device type from a list of devices supported by the Xcode version set as current on your local machine.</li>
<li>In the <b>OS version</b> field, select an OS version from a list of OS versions supported by the selected device and the current Xcode version.</li>
</ul>
<p>To rename the selected simulator, select <b>Rename</b>.</p>
<p>To reset the contents and settings of the selected simulators, select <b>Reset</b>.</p>
<p>To delete the selected simulator, select <b>Delete</b>.</p>
<a name="checking-current-xcode-version"></a>
<h3 id="checking-current-xcode-version">Checking Current Xcode Version</h3>
<p>To check the current Xcode version, enter the following command:</p>
<p><code>xcode-select --print-path</code></p>
<p>To change the version, enter the following command:</p>
<p><code>xcode-select --version</code></p>
</div>
<!-- @@@creator-developing-ios.html -->
<p class="naviNextPrevious footerNavi">
<a class="prevPage" href="creator-developing-generic-linux.html">Connecting Embedded Linux Devices</a>
<span class="naviSeparator">  &#9702;  </span>
<a class="nextPage" href="creator-developing-mcu.html">Connecting MCUs</a>
</p>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
